<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <title>xrkmonitor - 登录</title>
	<link rel="icon" href="<?cs var:config.docpath?>/themes/default/images/zifu_48.ico">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
	<meta name="keywords" content="字符云监控系统,云监控系统,监控提醒,日志系统,云日志系统,日志汇聚,多云部署">
	<meta name="description" content="字符云监控系统-多云部署一站监控,一切尽在掌握!">
	<meta name="author" content="rockdeng,1820140912@qq.com,qq:1820140912">
	<meta name="renderer" content="webkit">
	<?cs if:config.xrkmonitor_debug==1 ?>
	<link href="<?cs var:config.docpath?>/themes/css/login.css" rel="stylesheet" />
	<link href="<?cs var:config.docpath?>/themes/layui/css/layui.css" rel="stylesheet" />
    <link href="<?cs var:config.docpath?>/themes/sideshow/css/normalize.css" rel="stylesheet" />
    <link href="<?cs var:config.docpath?>/themes/sideshow/css/demo.css" rel="stylesheet" />
    <link href="<?cs var:config.docpath?>/themes/sideshow/css/component.css" rel="stylesheet" />
	<link href="<?cs var:config.docpath?>themes/sexybuttons/sexybuttons.css" rel="stylesheet" /> 
	<?cs else ?>
	<link href="<?cs var:config.docpath?>/themes/css/login.min.css?v=20200507" rel="stylesheet" />
	<link href="<?cs var:config.docpath?>/themes/layui/css/layui.min.css?v=20200506" rel="stylesheet" />
    <link href="<?cs var:config.docpath?>/themes/sideshow/css/sideshow.min.css?v=20200506" rel="stylesheet" />
	<link href="<?cs var:config.docpath?>/themes/sexybuttons/sexybuttons.min.css?v=20200507" rel="stylesheet" /> 
	<?cs /if ?>
</head>

<body class="kit-login-bg" style='overflow:hidden'>
<div class="container demo-1">
    <div class="content">
        <div id="large-header" class="large-header">
            <canvas id="demo-canvas"></canvas>
            <div class="kit-login-box">
                <header>
					<?cs if:config.isdaemon == 1 ?>
                    <h2>字符云监控系统 - <font color='red'>演示版</font></h2>
					<?cs else ?>
                    <h2>字符云监控系统</h2>
					<?cs /if ?>
                </header>
                <div class="kit-login-main">
                    <div class="layui-form" method="get">
                        <div class="layui-form-item">
                            <label class="kit-login-icon">
                                <i class="layui-icon">&#xe612;</i>
                            </label>
							<?cs if:config.free_uname ?>
                            <input type="text" id="username" lay-verify="userKey" autocomplete="off" value='<?cs var:config.free_uname ?>' class="layui-input">              
							<?cs else ?>
                            <input type="text" id="username" lay-verify="userKey" autocomplete="off" placeholder="输入用户名" class="layui-input">              
							<?cs /if ?>
                        </div>
                        <div class="layui-form-item">
                            <label class="kit-login-icon">
                                <i class="layui-icon">&#xe6b1;</i>
                            </label>
							<?cs if:config.free_upass ?>
                            <input type="password" id="password" lay-verify="password" autocomplete="off" value='<?cs var:config.free_upass ?>' class="layui-input">             
							<?cs else ?>
                            <input type="password" id="password" lay-verify="password" placeholder="输入密码" autocomplete="off" class="layui-input">             
							<?cs /if ?>
                        </div>
                        <div class="layui-form-item">
                            <div class="kit-pull-right">
                                <button id='btn_login' onClick='return login_submit();' class="layui-btn layui-btn-primary" lay-submit lay-filter="login">
                                    <i class="fa fa-sign-in " aria-hidden="true"></i> 登 入
                                </button>                               
                                <button id='btn_clear' onClick='return clear_input();' class="layui-btn layui-btn-primary" lay-submit lay-filter="login">
                                    <i class="fa fa-sign-in" aria-hidden="true"></i> 重 填 
                                </button>                               
                            </div>
                        </div>
                        <div class="layui-form-item" align='center' style='height:20px'>
							<font id="loginmsg" style='font-weight:bold;font-size:14px;'></font>
						</div>
                    </div>
                </div>
				<footer>
					<button style='float:left;width:120px;margin-left:10px;' title='站点访问数据' class="sexybutton sexysimple"><span class="chart_bar">0 / 0</span></button>
					<a style='margin-left:35px; float:left; position:static;' title='码云源码链接' target='_blank' href='https://gitee.com/xrkmonitorcom/open/stargazers'><img src='https://gitee.com/xrkmonitorcom/open/badge/star.svg?theme=dark' alt='star'></img></a>
					<button title='字符云监控系统云版本' style='position:static; margin-left:35px; float:left;' class="sexybutton sexysimple" onClick='goto_online();'><span class="home">云版本</span></button>
				</footer>
            </div>
        </div>
    </div>
</div>

<?cs if:config.isdaemon == 1 ?>
<script src="<?cs var:config.docpath?>js/dmt_xrkmonitor.js"></script>
<?cs /if ?>

<?cs if:config.xrkmonitor_debug==1 ?>
<script src="<?cs var:config.docpath?>js/jquery-1.7.2.js"></script>
<script src="<?cs var:config.docpath?>js/jquery.md5.js"></script>
<script src="<?cs var:config.docpath?>js/jquery.cookie.js"></script>
<script src="<?cs var:config.docpath?>js/sideshow/TweenMax.js"></script>
<script src="<?cs var:config.docpath?>js/sideshow/rAF.js"></script>
<script src="<?cs var:config.docpath?>js/sideshow/demo-2.js"></script>
<script src="<?cs var:config.docpath?>js/dmt.comm.js" type="text/javascript"></script>
<?cs else ?>
<script src="<?cs var:config.docpath?>js/jquery.min.js?v=2020506"></script>
<script src="<?cs var:config.docpath?>js/jquery.other.min.js?v=2020506"></script>
<script src="<?cs var:config.docpath?>js/dmt.comm.min.js?v=20200506" type="text/javascript"></script>
<script src="<?cs var:config.docpath?>js/sideshow/sideshow.min.js?v=20200506"></script>
<?cs /if ?>

<script language="javascript" type="text/javascript">
	var g_req_timestamp = 0;
	var g_login_in_cust_server = 0;

	function goto_online()
	{
		window.open('http://xrkmonitor.com', '_blank');
	}

	function login_submit()
	{
		if ($('#username').val() == ""){
			$('#loginmsg').html('<font color="#ff0000">请输入用户名</font>');
			$('#username').focus();
			return false;
		}
		if ($('#password').val() == ""){
			$('#loginmsg').html('<font color="#ff0000">请输入密码</font>');
			$('#password').focus();
			return false;
		}
		$('#btn_login').addClass('layui-btn-disabled');
		
		var requrl = "<?cs var:config.cgipath?>slog_flogin";
		var reqpara = {};
		reqpara.username = $('#username').val();
		var input_passwd = $('#password').val();
		var pass_md5 = $.md5(input_passwd);
		reqpara.password = pass_md5;
		reqpara.action = "check";
		reqpara.response_method = "json";
		reqpara.redirect_url = "<?cs var:config.redirect_url ?>";
		reqpara.login_type = 0;

		var d = new Date();
		g_req_timestamp = d.getTime();

		$('#loginmsg').html('<font">正在验证用户身份……</font>');
		$.ajax({
			url:requrl, 
			data:reqpara, 
			success:function(result){
				$('#btn_login').removeClass('layui-btn-disabled');
				switch (result.code) {
					case 0:
						document.location = result.redirect_url;
						break;
					case 8:
						if(g_login_in_cust_server != 0) {
							$('#loginmsg').html('<font color="#ff0000">系统错误，请稍后刷新网页重试。</font>');
						}
						else {
							window.location = result.cust_login_server;; 
						}
						break;
					default:
						$('#loginmsg').html('<font color="#ff0000">用户名或密码错误！</font>');
						$('#username').focus();
						break;
					}
				}, 
			error:function(q,errmsg,err){
					$('#btn_login').removeClass('layui-btn-disabled');
					var hm = '<font color="#ff0000">验证失败，服务器异常！';
					hm += "错误信息：" + errmsg;
					hm += '</font>'
					$('#loginmsg').html(hm);
				},
			dataType:'json'
		});	
		return false;
	}

	function clear_input()
	{
		$('#password').val("");
		$('#username').val("");
		$('#loginmsg').html("");
		$('#username').focus();
		return false;
	}

	$(document).ready(function(){
		<?cs if:config.isdaemon ?>
			<?cs if:config.free_uname ?>
			$('#btn_login').focus();
			<?cs else ?>
			$('#loginmsg').html('<font color="#ff0000">当前无可用演示账号, 请稍后再试 ...</font>');
			<?cs /if ?>
		<?cs else ?>
		$('#username').focus();
		<?cs /if ?>
	}).keydown(function(event){
		if(event.keyCode==13){
			login_submit();
			return false;
		}
	});
</script>

</body>
</html>

